import axios from '@/utils/request'
export default {
  StoreSpecification: {
    list: {
      actions: [
        {
          name: '批量同步',
          position: 'top',
          component:
            () => import('@/views/store-product/add-store-products-batch.vue')
        }
      ],
      list_filter: {
        'store.id': () => {
          return axios
            .get('/manage/stores', { params: { limit: 1000 }})
            .then(res =>
              Object.assign(
                { __label: '门店' },
                ...res.data.map(v => {
                  return { [v.id]: v.name }
                })
              )
            )
        },
        'product.name': '产品'
      },
      list_display: [
        'store',
        'specification',
        {
          property: 'price',
          label: '成本',
          enabled: true
        },
        'listOrder'
      ]
    },
    form: {
      fields: '__all__'
    }
  }
}

